﻿
using System.Collections.Generic;
using Business.Entities;
namespace Business.Logic
{
    public interface IOutlookApi
    {
        /// <summary>
        /// Sets the specified google id on the given task's implementation-specific object
        /// </summary>
        /// <param name="googleTask"></param>
        void SetGoogleId(Task googleTask);

        /// <summary>
        /// Sets the specified google id on the given task's implementation-specific object
        /// </summary>
        /// <param name="googleTask"></param>
        void SetGoogleId(Task googleTask, bool updateListId);
        
        /// <summary>
        /// Converts the specified task of implementation-specific type to a DesktopBusiness.Entities.Task
        /// </summary>
        /// <param name="oTask"></param>
        /// <returns></returns>
        Task ConvertTask(object oTask);

        /// <summary>
        /// Insert task. 
        /// </summary>
        /// <param name="oTask">Task object</param>
        /// <param name="category">Catgeory (task list name). If null, will not be set</param>
        void InsertTask(Task oTask, string category);
        
        /// <summary>
        /// Update task. 
        /// </summary>
        /// <param name="oTask">Task object</param>
        /// <param name="category">Catgeory (task list name). If null, will not be set</param>
        void UpdateTask(Task oTask, string category);

        /// <summary>
        /// Deletes the specified task
        /// </summary>
        /// <param name="oTask"></param>
        void DeleteTask(object oTask);

        /// <summary>
        /// Sets the ordinal of the specified task by the google id from last getalltasks
        /// </summary>
        /// <param name="googleId"></param>
        /// <param name="child_id">Children</param>
        /// <returns></returns>
        void SetOrdinalByCachedGoogleId(string googleId, int ordinal, string[] child_id);

        /// <summary>
        /// Returns all outlook tasks as a taskroot object
        /// </summary>
        /// <returns></returns>
        TasksRoot GetOutlookTasks();

        /// <summary>
        /// Returns true if an outlook task with the specified google id registred exists
        /// </summary>
        /// <param name="googleId"></param>
        /// <returns></returns>
        bool ExistsGoogleTask(string googleId);

        /// <summary>
        /// Returns true if an outlook task with the specified google id registred exists
        /// </summary>
        /// <param name="googleId"></param>
        /// <returns></returns>
        Task GetGoogleTask(string googleId);

        /// <summary>
        /// Updates the snapshot in the outlook for mobile task item
        /// </summary>
        /// <param name="task"></param>
        void SetSnapshot(Task task, bool save);

        List<string> GetGoogleIds();
    }
}
